package ge.gen.eBdgt.persistence;

import ge.gen.eBdgt.db.DBUtils;
import ge.gen.eBdgt.vo.CmuTrackVO;
import ge.gen.eBdgt.vo.IcnVO;
import ge.gen.eBdgt.vo.OutageMonthVO;
import ge.gen.eBdgt.vo.ProjectKindVO;
import ge.gen.eBdgt.vo.TeamWrkLoadVO;

import java.util.ArrayList;
import java.util.List;

public class IcnTableDao implements IcnTableImplDao {

	private DBUtils icnDBManager;

	public IcnTableDao() {
		icnDBManager = new DBUtils("C://TEMP//gen2000.mdb");
	}

	private ArrayList<String> getColumnList() throws Exception {
		return (ArrayList<String>) icnDBManager.getIcnList();
	}

	public List getAllIcns() throws Exception {
		return icnDBManager.getIcnList();
	}

	public List getAllCmuTrack() throws Exception {
		return icnDBManager.getCmuTrackList();
	}

	public IcnVO getIcnInfo(String id) throws Exception {
		return icnDBManager.getIcnVO(id);
	}

	public boolean update(IcnVO vo) throws Exception {
		boolean flag = true;
		
		flag = icnDBManager.updateIcnVO(vo);
		
		return flag;
	}

	public boolean insert(IcnVO icnDetailVO) throws Exception {
		return icnDBManager.saveIcn(icnDetailVO);
	}

	public boolean delete(String id) throws Exception {
		return icnDBManager.deleteIcn(id);
	}

	@Override
	public List searchByDescr(String descr) throws Exception {
		return icnDBManager.getDescriptionCriteria(descr);
	}

	@Override
	public List searchByIcn(String icn) throws Exception {
		return icnDBManager.searchByIcn(icn);
	}

	@Override
	public IcnVO displayIcn(String icn) throws Exception {
		return new IcnVO();
	}

	@Override
	public List getIcnList() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public CmuTrackVO getCmuTrackInfo(String id) throws Exception {
		return icnDBManager.getCmuTrackVO(id);

	}

	@Override
	public boolean insertCmuTrack(CmuTrackVO emp) throws Exception {
		return icnDBManager.saveCmuTrack(emp);
	}

	@Override
	public boolean updateCmuTrack(CmuTrackVO emp) throws Exception {
		return icnDBManager.updateCmuTrack(emp);
	}

	public List<IcnVO> searchByStatus(String status) {
		return icnDBManager.getStatusCriteria(status);
	}

	public List<IcnVO> searchByCustomer(String customer) {
		return icnDBManager.searchByCustomer(customer);
	}

	public List<IcnVO> searchByAddlScope(String searchValue) {
		return icnDBManager.searchByAddlScope(searchValue);
	}

	public List<IcnVO> searchByMainScope(String searchValue) {
		return icnDBManager.searchByMainScope(searchValue);
	}

	public List<IcnVO> searchByReqEngr(String searchValue) {
		return icnDBManager.searchByReqEngr(searchValue);
	}

	public List<IcnVO> searchBySerNum(String searchValue) {
		return icnDBManager.searchBySerNum(searchValue);
	}

	public List<IcnVO> searchByStation(String searchValue) {
		return icnDBManager.searchByStation(searchValue);
	}

	public List<TeamWrkLoadVO> getTeamWrkLoad() {
		return icnDBManager.getTeamWrkLoad();
	}	
	
	public List<OutageMonthVO> getOutagesByMonth(int mn, int yr) throws Exception {
		return icnDBManager.getOutagesByMonth(mn, yr);
	}

	public List<ProjectKindVO> getProjectsByKind(String yr) {
		return icnDBManager.getProjectsByKind(yr);
	}

	public List<String> getAllYears() {
		return icnDBManager. getAllYears();
	}

	public String getSerialNo(String string) {
		return icnDBManager.getSerialNo(string);
	}

	
}